package ar.edu.unlu.sistemas.p2p.business.vo;

import java.util.ArrayList;
import java.util.Collection;

import ar.edu.unlu.sistemas.p2p.business.task.Result;

public class PeerResultsVO {
	
	private String peerId;
	private Collection<Result> results ;
	
	public PeerResultsVO (String peerId) {
		this.peerId = peerId;
	}
	
	public String getPeerId() {
		return peerId;
	}
	public void setPeerId(String peerId) {
		this.peerId = peerId;
	}
	public Collection<Result> getResults() {
		return results;
	}
	public void setResults(Collection<Result> results) {
		this.results = results;
	}
	
	public void addResults(Collection<Result> results) {
		if (this.getResults() == null) {
			this.setResults(new ArrayList<Result>());
		}
		this.getResults().addAll(results);
	}
	
	public void addResult(Result result) {
		if (this.getResults() == null) {
			this.setResults(new ArrayList<Result>());
		}
		this.getResults().add(result);
	}
	
	public boolean hasResults() {
		return this.getResults() != null;
	}
}
